The short story for why chess has a castling.

image