yes takes CPU usage to 99%
It is because Activity Monitor displays CPU usage as a percentage of a single core. So 100% means that one core is fully occupied.

The percentage can thus be higher than 100% when a program utilizes multiple cores.

The “yes” program is designed to use only one core, and use it fully. Therefore the behavior you’re seeing is entirely normal.