Serotonin receptor type 3 (5-HT3) present in both GI tract and central nervous system. It mediates the neurotransmission of signals on irritants present in GI tract or bloodstream, thus playing important role in pathogenesis of nausea (although it is by far not the sole mechanism). Ondansetron is a potent blocker of of 5-HT3 receptor - thus inhibiting this pathomechanism.
You can find a good review at https://go.drugbank.com/drugs/DB00904