The kanji 混 refers to mixing where you lose the ability to separate the original items, like mixing paints, or flour and eggs.
The kanji 交 refers to mixing where you can separate the items again after mixing them, like colored marbles, or numbers and letters in a string of characters.
まぜる is transitive, まざる and まじる are intransitive.
That page explains the kanji meanings, but then goes on to talk about some confusing usages. Such as 混合リレー for a race where men and women run together, or トランプにジョーカーを混ぜる for mixing a joker into a deck of cards.
You can tell men and women apart, and cards are identifiable, so you would think 交 is better, but the page explains why those use 混. Basically, because the members become a single team, and because the purpose of mixing the joker into the deck is so that people don’t know where it is, so 混 is more appropriate.
Whether that makes sense to you, or you just have to remember those as exceptions, I’m not sure.