Knowing when to join in with play comes with experience and observation. For very young children the child needs a play partner to play with or along side. Joining in with play with both young and older children needs to be done very sensitively.
Sometimes the adult is invited to join the play and then they need to follow the child’s lead. After careful observation you might see an opportunity to sensitively advance the play. Interference in play can disrupt the flow, particularly when the adult is trying to steer the pay in another direction. Play between children can veer off into all sorts of unexpected and productive areas that adults can’t and shouldn’t control.