M4A is AAC in Apple's favorite outfit: the audio-only MP4 your iPhone speaks natively. It was born in 2003, popularized by Apple's iTunes Store, and its real weak spot is older Windows software and stubborn car stereos that expect a .mp3.
WMA is Windows' old house band: big in the early 2000s, mostly retired now. Windows Media Audio, in several variants including a rarely-sighted lossless one. That makes it the right destination when what you need is keeping aging Windows Media software and old archives happy.