We usually use "thanks to" when referring to the cause of something beneficial, that is, something we approve of and are grateful for, like in your example: "It's thanks to Sandy that I heard about the job." -- finding out about the job is a good thing, and we are happy with Sandy. The dictionary doesn't bother to point out that this is approving, since it's the literal meaning, and goes without saying to a native speaker -- maybe someone should tell the folks at Cambridge that ESL learners are using their dictionaries.....
The dictionary then goes on to give a less usual, sarcastic meaning, which it labels specifically as dissaproving, since it's counterintuitive. This is equivalent to thanking someone when he accidently does something bad to you "Thanks for giving away my secret -- thanks a lot." (In a sarcastic tone)