final interrogative particle
嗎 is a grammatical particle used at the end of a sentence to turn a statement into a question, similar to a spoken question mark.
嗎 combines 口 (mouth) with 馬, which likely contributes the sound. The character was created to represent a spoken interrogative particle.
The mouth 口 asks a question, and the horse 馬 neighs back as if answering. 嗎 turns a statement into a question.
For バ, imagine a horse braying 'baa' like a sheep when it hears a question: baa -> バ, and the mouth asks the question.