How does rated motorcycle ccs work?

Specifically, I noticed that virtually all displacements of motorcycle engines are just slightly underrated. For instance, the Kawasaki Ninja 250 engine is actually 249cc of displacement. Similarly, the Honda website rates the 125cc from engine at 124.9cc. I've noticed this with a majority of motorcycles I've come across; their true displacement is slightly below their rated displacement. Any ideas why? Is this for some legal purpose?

Read more: How does rated motorcycle ccs work?