So honestly, I'm really not sure if a baby reasons that way. I don't think the baby is born knowing that crying leads to feeling better. I think the baby just does it, the same way a cat meows when it's hungry. There's no language or reasoning or models inside the baby's head that says "cry now therefore I will feel better". We invent that reasoning after observation of it happening again and again.
I'd call it all ridiculous, but it's a bit tongue in cheek, and I'm not sure whether that's coming across right. Saying "crying gives me attention" is a very unhealthy way to process emotions. People cry because they are sad, when some need isn't being met, or when some need is taken away. We aren't much different from babies in that regard.
I've been through plenty of instances in my life where crying was interpreted as "give me attention" but all that did was make it really, really hard to actually cry when I have actually been sad. Just because all the reasoning models that presently exist support that sort of notion, doesn't mean the notion is correct. It is important to be able to cry. Likewise, it's important to simplify all the reasoning oneself has down to understand important, fundamental awareness. Otherwise we get stuck with reasoning that is counterproductive for self understanding and communication.