First off, if you're referring to the most common rimfire .22, it's a .22LR (short for 'long rifle'). It's important because there are others such as .22 short, .22 WMR (Winchester Magnum Rimfire, also the parent case of the .17 HMR) as well as others. The .17 HMR (Hornady Magnum Rimfire) is basically the .22WMR case necked down for a .17 cal projectile. If comparing the rimfire rifles to centerfire rifles the two major differences are ammunition cost and velocity/energy. As noted, you can get 500 rounds of .22LR for around $20, the same amount of cartridges in .22-250 will set a guy back around $500. The math is easy, there's way more trigger time for the same money using a rimfire. Hough the rimfire won't reach out over greater distances like a centerfire, as the buets are launched much slower from a rimfire and they lose altitude and kinetic energy much sooner, as they start with much less kinetic energy.
.22LR is the far right, .22-250 is second from the left. All of them shoot .22 calibre projectiles. Guess which one is more powerful and more expensive?