People don't knowingly buy at the top. They get excited to see a rising market and fear being left behind. These are also the people who have been too conservative with their approach and when everyone around them has made money and is talking about it constantly, they can't take it any more and jump in.
Some very able traders also buy at the top. The difference is that the able trader exis when the price refuses to go up, while the average Joe would stay in, in hopes of price to go up again.
Another thing to note is that a top is identifiable only in hindsight. In real time it's just price moving up. It's the stoppage of that upward move and a reversal that creates the top. The price is unable to get back to the previous high and heads lower over time.
Gringo