If you afk or inten feed like once every hundred games you probably wont get punished. Otherwise riot will probably ban way too many accounts. Also, should riot punish these people regardless of game mode or do they prioritize ranked more than the other game modes? I think in order to keep things simple they only punish those who repeatedly ruin games (like maybe once every dozen games or some sort of metric like that). Also, if someone admits to afking and actually does afk they usually get placed in a "special" queue where there is an added 5 minute waiting time before entering the actual queue. I know because I've experienced it twice before. It usually happens when I afk or DC more than once in a row or within a few games.
Doing it once has no punishment and the reason is probably because what if that person DC'd or had some IRL issue to resolve and they had to physically leave their computer? If the person does this repeatedly then riot can eliminate the possibility of these outside factors and determine if you are afking on purpose. Even if someone types in "i'm afk" in chat the reason may be one of the 2 I said so a one time incident will not cause a punishment.