Yoga and Pilates are not really related.
They have different purposes and different effects on the body.
Here is a history of how Joseph Pilates developed his system. He had studied yoga among other things, but the movements are his own. It is particularly useful for strengthening your core muscles.
Yoga is far more ancient. It is a spiritual tradition designed to coordinate mind and body. It has many forms. In the U.S., many people practice yoga for its health benefits only. While traditional yoga is based on slow movement, there have been offshoots of “hot yoga” designed for the Western “do more, quickly” mindset. To me, that is diametrically opposed to yoga principles.
Yoga rewards practitioners with much greater flexibility and balance among other things.