Completely rounded vs Rounded rectangle buttons

I was curious to know why at some places completely rounded buttons are used and other places of the same application there are rounded rectangle buttons?

As far as I could understand, small Rounded-rectangle buttons might visually look like a badge, but then why not use completely rounded buttons for full width button as well? Is it matter of design language or there is a deep logic?

enter image description here