The M17 is the full size pistol, comparable in size to a Glock 17. The M18 is the compact, similar in size to a Glock 19.
The military is purchasing some of both, not exactly sure who gets what.
I have the M17 and like it a lot. Will eventually buy the smaller M18. I've seen one available when I was short of cash. Went to buy it yesterday and it was gone. Don't know when they will be available again.
Looks like the Marines chose the compact
https://www.sigsauer.com/products/firearms/pistols/m17-m18/