There’s a population of planets that drifts through space untethered to any stars. They’re called rogue planets or free-floating planets (FFPs.) Some FFPs form as loners, never having enjoyed the company of a star. But most are ejected from solar systems somehow, and there are different ways that can happen.