@keety I think a lot of it is just from availability. Regular pepper was the only thing remotely spicy in our household when I grew up, so I really was not used to any spice until I became an adult and started to go to restaurants with other cuisines.
So for one thing, as others have said, flavors that the mom eats can be tasted by the baby through the amniotic fluid, that's one thing.
Also, it's a matter of dosage. For example, if we eat a semi-spicy curry with potatoes and meat, we will cook the meat and the potatoes in the curry sauce.
My kid would not get a full ladle of curry sauce on his rice, that would have been too hot, but we'd give him rice, potatoes and meat that still had a bit of sauce stuck to it. That way he got the flavors and a tiny bit of spice. And after a while, you can add a dab of sauce to the rice and increase that slowly if the child likes the taste.