Complex sentence: When they come close to the spiral arm, they are pulled towards the dense material by the force of gravity; and as they travel through the arm, they are slowed from exiting by the same gravitational pull.
Split into simpler sentences: When they come close to the spiral arm, they are pulled towards the dense material by the force of gravity. However, as they travel through the arm, they are slowed from exiting by the same gravitational pull.