Planets may be ejected from their original star system due to a passing star or black hole, resulting in a rogue planet.