How come some algorithms are better for GPU mining vs CPU mining?
Both are computational units. Algorithms are typically written without making assumptions about underlying chips that are going to run those algorithms, but certain type of tasks can benefit from massive parallel processing that GPUs, which increases GPUs appeal in mining, machine learning, etc.
https://blogs.nvidia.com/blog/2009/12/16/whats-the-difference-between-a-cpu-and-a-gpu/
Specific explanations about ML and mining can be found here:
https://www.quora.com/Why-do-people-use-expensive-GPUs-for-Bitcoin-mining-and-not-multiple-CPUs-like-Quad-Xeon
https://www.quora.com/Why-are-GPUs-well-suited-to-deep-learning