The difference in quality depends on a few factors, of which you listed the major ones: microphone, interface and processing unit (sound card in this case).
Using a 3.5mm mic-in or line-in means the sound card in your computer must transform the analog signal from the mic into a digital signal that the CPU can understand. It does this with the help of an ADC; Analog to Digital Converter. The means which sound cards do this varies depending on brand and model. As you can see, there are already a ton of factors that influence quality.
This goes for the other way around as well; sounds that your applications and computer produces are converted from a digital to an analog signal with the help of a DAC; Digital to Analog Converter.
The DAC/ADC your sound card uses also has effect on the quality of the sound.
Generally speaking, the DAC in your sound card is better in preserving quality than your ADC. This is because the translation from a clear digital signal to a clear analog signal is easier than the other way around.
Now, there are also microphones (headsets) that connect through USB. This means that the microphone (or headset) have an internal DAC/ADC that is (usually) better at preserving the quality of the sound when transferring to and from your computer, but not much.
If you have an external DAC/ADC, which is, with much care and attention, specifically designed to convert an analog to a digital signal and the other way around, you alleviate the problem that most motherboard and sound card manufacturers cope with: cost. Your sound card is often the first component that gets stripped down to save costs on your system/motherboard, as the quality it normally produces is enough for all-day use.
Then there's the case of EMI; Electromagnetic Interference. Sound cards are (usually) housed in your case, in a PCI-E slot on your motherboard. This means the sound card is close to other components that emit EMI, which can lead to static, noise and more generally speaking: loss of quality. More on EMI here:
So, if you want to start with music production or just want an all-round better experience with games, movies and the like, you're going to have to throw some extra cash and go for a sweet DAC/ADC.