How does stream entry occur? When a person becomes a stream enterer/Sotapanna, I understand they no longer have the first 3 fetters of belief in a self, doubts about the Buddha, his teachings or the noble sangha, or attachments to rites and rituals. But what's not clear to me is the mechanics of it. Does a person have a glimpse of Nibbana in a moment of true mindfulness and the three fetters drop away? Or does a person work at eradicating the first 3 fetters and if successful have a taste of Nibbana? Or can it happen either way?
Stream-entry is very simple, there is nothing supernatural about it. Stream-entry is when the practitioner has fully understood the vision behind Buddha's teaching, has fully assembled the puzzle, and now has no doubts about what Buddha meant when he said certain things or why he said them. Having a clear vision of what Buddha was referring to includes clearly seeing the reality behind Three Marks of Existence and the actual mechanism behind the Four Noble Truths.

Because most of us are so dominated by our preconceptions about the world, and about Buddha-Dharma, stream-entry is difficult or virtually impossible to attain from mere theoretical study of sutras, or from one super-successful meditation session, when one gets a "glimpse of Nirvana". Instead, stream-entry requires an effort consistently applied over a long period of time, targeted at putting Sat-Dharma to practice in day-to-day life.

The reason it's called "stream"-entry, is not because one enters some magical stream, but because one finally sets foot on the unquestionably right road towards Nirvana, having really understood the whole thing.

As I understand, what he subsequently called stream-entry (attaining a clear understanding of Three Marks of Existence and Four Noble Truths -- and therefore cutting all doubts) was attained by Buddha at time of his Bodhi, but because he had already liberated his mind from most of the other asavas by then, he effectively achieved full Nirvana at once. But in case of Buddha's students (and ourselves), because we do have the advantage of teaching available to us, we can assemble the puzzle while still having residual mental/emotional obscurations. Hence the need to have a separate name for this stage, distinct from "bodhi".

As for how exactly stream-entry occurs. It occurs through exhausting samsara. In order to exhaust samsara you must exhaust ego. In order to exhaust ego you must explore all corners where Enlightenment might hide, until you know you couldn't have possibly missed it. Then it finds you :)