AK-47 - Not as easy as M4A1 to control, more damage, the only thing you can do with that weapon is to headshot people, bodyshots are kinda useless.
M4A1 - Too easy on controlling, that's why it's preferred for spraying and bodyshots. Less damage, and even less if a silencer is on.
So, if we have two same skill level players from low distance the M4A1 player wins, but from a big distance, more chances go to Ak-47.