There are many homonyms in Japanese. For example, kôen can mean "park," "lecture," "support," and so on... The pronunciation of them all is exactly the same, so you have to judge the meaning from the context. Ayamaru has two totally different meanings: "make a mistake" and "apologize."
Some words are basically pronounced the same, but their meaning changes depending on the intonation. For example, hashi means "bridge", "chopsticks" and "end".
Finally, here’s a fun tongue-twister for you to practice, using several different meanings of niwa.
Ura niwa niwa niwa, niwa niwa niwa niwatori ga iru.
It means: "There are two chickens in the back garden and two in the garden."