If you are speaking about an intentional delay, then that's usually indicative of a queuing mechanism which is used to help level off spikes in extreme activity. It would more than likely be a producer-consumer model which would have the posts put in a queue and then the queue is read and the database updated.
It's also possible that you are seeing caching somewhere down the line between the server and your client (it can be through your ISP, through a proxy server, or your own browser cache), and you need to update the page/list.
Speaking specifically of Stack Overflow, I've never seen it take 20 seconds for a question/answer to appear, it's always been instantaneous, and I don't believe such a queue mechanism is implemented, although to be sure, you should probably ask the question on Meta Stack Overflow if you want to know about Stack Overflow specifically.