How do central bank interest rates affect currency prices?

Been trading for a while but still trying to wrap my head around this.

When the Fed or ECB changes rates, I see immediate moves but sometimes the opposite of what I expect. Is it just about rate differentials or are there other factors I’m missing here?