Imagine you are in a boat on the ocean. The horizon is the line where the sky meets the sea. The horizon is as far as you can see. Literally, if you see something on the horizon, it is far away and yet you can see that it is there.
Figuratively, "on the horizon" can mean "as far as you can see into the future." "I see trouble on the horizon" means "I am certain there will be trouble, even though it won't happen immediately."
Here are some examples of use.
"The government is spending too much. Everything seems all right now, but there is trouble on the horizon."
"That company's stock is rising, but they are facing competition they have never faced before, and I see trouble on the horizon."
Here's an actual headline: "Tesla's new Model 3 sedan has test drivers swooning — but quality issues lurk on the horizon."