Earpod plug in but the sound come out with speaker iPhone 5?

It just happen today. My earpod plug in and the sound come out the speaker. It doesn't
Alway happen but sometime it happen. Like when I listen To music and I get text it comes out the speaker and when I turn the music back on, it come out the speaker so I have to unplug the earpod and plug it in again. How can I fix this?

A droid will fix that problem

Water damage of sounds like