Why is it common to castle right after the opponent castles? After watching many chess games, I've noticed that many players castle right after their opponent castles. Is this a coincidence? Or is there an unspoken benefit of this? 

Edit: And by right after I also mean right before. I.e. games where both castling taking place one turn apart.
Castling is a certain 'committing' move; if you castle kingside, your king is stuck there until the late middlegame / early endgame, and you cannot easily launch a pawn storm on that side. The first allows your opponent to castle queenside and know he/she can launch a king attack (but possibly allowing your attack as well); the second allows your opponent to castle kingside and know his/her king is relatively safe.

Also, the castling move doesn't threaten anything (like capturing an undefended piece, or a fork), so if you castle, the opponent doesn't have to defend and has time to castle as well.

A final thing to note is that castling can occur as early as move 4, and really late (move 20 or later is not that uncommon), but in most games it happens between moves 6-12*. This makes the probability that both castling moves (if both players castle) happen right after each other much higher than if castling would happen throughout the entire game.

*: I'm just making an educated guess here; I'm very interested in the actual statistics.