Short version:
-In the late 70s, the contributions and musical input from Nick Mason and Richard Wright were practically nil (in the case of Wright, because he was doing tons of coke), and while Gilmour still wrote a lot of stuff, Waters pretty much grabbed control of the band.
-When recording The Wall, Waters forced Wright out of the band, telling him he'd scrap the album if he didn't agree to leave. Wright desperately needed money, so he agreed, and unbeknownst to anyone, when they toured on The Wall, Wright was no longer an official member of the band and was paid the same as an extra would be (which was ironic then, as he made money on the tour, while the remaining Floyds lost money on it cause of the massive expense of the show).
-Waters then insisted on recording The Final Cut using mostly material that was deemed not good enough for The Wall. Gilmour strongly objected to this, but Waters did it anyway, and Gilmour's input on that record was practically nothing.
-Thinking the band would never go on without him, Waters left the band in 1985, but got a rude awakening when the band did decide a year or so later to go on without him. He tried to legally stop them, but since he had left the band on his own accord, instead of staying and letting it die a slow death, he couldn't stop them.
-His resentment and pettiness is the main reason why he has been so critical of the two albums they did since his departure. It was also extremely galling to him that when he toured at the same time as Floyd did in 1987 and 1988, Floyd made a killing and drew huge everywhere, while Waters struggled badly. That only made his resentment that much stronger.
And actually, Waters did always acknowledge that Gilmour was a musician of note and was always integral to the Floyd sound, but insisted that the other two did nothing in his later years in the band.