First of all, what follows is handwaving - things don't work exactly this way for a number of reasons.
But you can imagine a series of not-too-unlikely breakthroughs:
- advances in high-temperature superconductors allow the creation of a novel type of miniaturized SQUID sensor. (This is a key element in Robert J. Sawyer's The Terminal Experiment)
- advances in processor design and fabrication techniques (probably using soft X-ray etching) lead to a new generation of ultra-low-voltage CPUs, whose low heat signature allow packing a whopper of computing power in a tiny package.
- the above allow the application of SAR/phased array technology to brainwave monitoring.
- advancements in AI allow the above to decode and predict in real time a human being's brain signals in a meaningful way, provided that they are wearing a suitable SQUID helmet and they have performed the necessary tuning and calibration - the "learning" phase.
- more expensive devices are leaner, faster, require less learning and have longer-lasting batteries. Just like smartphones.
To all intents and purposes, this is a limited form of super-fMRI in real-time.
While reading one's thoughts is not quite there yet (or is it?), somatic stimuli, proprioception, voluntary muscle activation and other signals are readable - and, after a lengthy period of acclimatization and tuning, writeable.
(The potential for abuse is staggering. You can look for YGBM, assessing one's true affections, trustworthiness and beliefs, or in SF - The Neutronium Alchemist by Peter F. Hamilton - something called persona-sequestrating nanonics. Or Larry Niven's current addicts. The simultaneous use of pain conditioning and feedback techniques would make the Manchurian Candidate or Beta Project look like a walk in the park in the good old days).
However, when all is said and done, the brain can be stimulated to "see", "smell", "hear", and in a limited way touch and taste, things that aren't there. In-brain VR is now possible.
Still more advanced systems could allow implanting memories: for example a politician or an executive looks at someone's face, and the helmet performs face recognition and dumps a short dossier on the guy directly in the user's working memory: he now knows the guy, his name, his tastes, his political agenda etc. - in the blink of an eye. The street price for such a device would go through the roof (and the "potential for abuse" knob is now set to 11).