Daisy Ridley
Prior to her role in The Force Awakens, Daisy Ridley was mostly an unknown commodity, which is what J.J. Abrams desired. Thus, Ridley was cast in the main role of the trilogy: Rey.
To fulfill her contractual obligations and to see out the end of the trilogy, it was only natural that she would appear in The Rise of Skywalker, the last film in the new trilogy.
Carrie Fisher
Fisher was originally cast for 1977's A New Hope. She later appeared in that film's sequels and The Force Awakens and The Last Jedi. However, Fisher tragically died prior to the start of The Rise of Skywalker's filming. Therefore, Abrams decided that he ought to repurpose old footage of Fisher from The Force Awakens and The Last Jedi so that Leia's story could finally end - even if it wasn't the end many Stars Wars fans were hoping and clamoring for.
Adam Driver
Unlike many of the actors in The Force Awakens who played new characters, Adam Driver was a known commodity most famous for starring in a T.V. show called Girls, the shooting schedule for which he was able to work around so that he could film Star Wars.
For Driver, The Rise of Skywalker was a way for him to give closure to a character which he spent a significant portion of his time playing.