I've learned both diatonic and pentatonic scales across the fretboard but when I go to solo, it sounds so much better to me if I use the pentatonic as a base and then pepper in some of the diatonic notes instead of just using the diatonic scale. Why is this the case? And when would I actually use the diatonic scale (besides old Christmas/Church songs like silent night and god rest ye merry gentlemen - which I somehow always end up playing when I play the diatonic scale).
The general answer is that pentatonic scales avoid some of the dissonances against the chords that occur naturally in the diatonic scales.
For example, suppose you're playing over a C Major chord. Choosing to play a C Major pentatonic gives you the three chord tones, C E G, which are guaranteed to sound good, plus D and A, which are the chordal 9th and 6th, respectively, and sound pretty good against the chord. However, the diatonic C Major scale includes F and B, both of which create fairly harsh dissonances if not used carefully.
A full answer to the question is highly dependent on the specific chord(s), scale(s), and larger musical context, but the general answer provides a roadmap: pentatonics will tend to contain fewer dissonances against the underlying chord.
Pentatonics are so much safer! The two notes that are most likely to sound out of place in any chord sequence are the two omitted from the diatonic set - 4 and 7. A tritone apart (both ways).
Those two notes are far more likely to clash with any chord likely to appear in common chord sequences. Without them, tunes using pentatonic notes do sound a little bland, but all of the five notes fit with pretty well whatever diatonic chord sequence is being used.
EDIT: noticed it's guitar tagged. There is a simple pattern of notes which is easy to remember and play on guitar - it's both major and minor pentatonic notes within the same pattern - all spanning three frets, and obviously dependent on where up the neck it's used for soloing in specific keys. True, there are other patterns involving the pents, but this particular pattern is probably the best known (and used) by guitarists.
That in itself is a very good reason it works, as the pattern is so simple, and all notes fall comfortably under the fingers, with no need to slide up/down to another position. That, along with the other points, is one main reason it's often the go-to for solos on guitar.