Spike had recently defeated Sombra and saved Equestria, Twilight had been busy with being the Princess of friendship and the other main 6 were busy with their roles in life, and feels a little depressed on it
Spike wishes to know what his destiny on a star one night and he falls asleep, unknownst to him destiny has much bigger things for him, he wakes up in front of an old turtle called Oogway and learns that he was brought here apparently by the Universe much to Spike's confusion,
Oogway tells him he is destined for something great and he is willing to teach Spike the art of Kung Fu and fulfill that roll, Spike accepts this and agrees to become a student, Oogway sends a message to Celestia about his destiny and she agrees to let him learn and decides to keep to tell the others at one point. From there Spike makes new friends and becomes what he was meant to be...The Dragon Master.