Berkeley and Locke
Kant's ideas did not arise out of nowhere. The groundwork for his thinking had been laid by others. John Locke, the British philosopher, had argued a century before that all knowledge is based on perceptions produced by the action of external objects on the senses. But whereas Locke thought this was a passive process -- the mind simply receiving the sense impressions -- Kant proposed that the mind is a participant in the process, actively shaping our experience of the world.
Unlike some of his predecessors, Kant was not saying that there is nothing apart from what exists in the mind. Bishop Berkeley had, some fifty years before, argued that we know only what we perceive, and had then concluded that only that which we perceive exists; the only reality is that experienced in the mind. This led him into the difficult position of having to explain what happened to the world when no one was perceiving it; which he tried to resolve by arguing that it was being observed in the mind of God. Kant's position was that there is an underlying reality that correlates with our experience, but just what this underlying reality is like, we can never know.