Okay so the insert of Alpha was done and it was coded red. Now after the insert the RB tree insertion code will check for imbalance between the red and black colors to determine if a rotation has to take place. After the check the Beta node was turned black, the Y node turned red and the gamma node turned black thereby keeping the tree RB balanced without need of rotation.
https://en.wikipedia.org/wiki/Red%E2%80%93black_tree
please see above wiki link to get a full explanation of how the color switches happen and why and how it helps determine rotation/s needed.