That was the love potion. If you had connected to a Tamagotchi of the opposite gender while those hearts appeared, they would have had children.
At least, I'm pretty sure that's how it works. I've never used it myself.
Yep you're right on with that explanation. Please keep in mind though both tamagotchies must be adult. Giving them the love potion right when they change will make sure they mate when they are ready. Giving them the potion when they are ready to mate (around age 5) will cause immediate mating