There are two sources of high energy particles entering the Earth's atmosphere from outer space: the sun and deep space.
The particles from deep space (inter- and extra-galactic) are much less frequent, but of much higher energies.