I previously thought you needed to buy a motherboard from that generation in order for it to work
You need a board with a compatible physical and electrical interface and a BIOS that recognises the processor.
When Intel makes a major breaking change they change to a different socket. Within a socket using newer boards with older processors is generally fine, using older boards with newer processors is sometimes but not always possible with a BIOS upgrade.
LGA775 had an unusually long life. It was introduced in december 2004 and remained the top desktop socket until November 2008 when LGA1366 was introduced. LGA775 was also unusual in that intel introduced a major redesign of the processor cores while keeping the socket the same.
Even after it was no longer the top socket LGA775 lived on. LGA1366 was a high end platform with a high price tag to match and no integrated graphics. LGA1156 was good for gamers but less suited to buisness desktops due to the lack of a quad core processor with integrated graphics.
Finally in January 2011, Intel released quad core processors with integrated graphics on a new socket LGA1155. It rapidly took over the mainstream desktop market from LGA775 and LGA1156 and even poached some of the high end market from LGA1366.
More recent sockets have had much shorter lives. Usually it is only a couple of years before a direct successor comes out.