In short, cognitive psych is all about how we think. We sense things, we process those things (creating a cognitive load), and our brain recognises and interprets the resulting patterns. One output of that is ‘how we feel about something’, which in turn results in an action (or actions). In order to design a great experience, we need to understand the cognitive capabilities and limitations of the user, so that we can predict how they might respond to something.
This article goes into a bit more depth around the relationship between UX and psychology in general.