D-Generation X was formed in 1997 by members of the Clique (Shawn Michaels, Triple H) and Triple H's bodyguard Chyna. Their 'insurance policy' ie bodyguard, Rick Rude also joined soon after. Michaels and Triple H were friends in real life.
D-Generation X feuded with the Hart Foundation stable through most of 1997, culminating with Bret Hart's controversial 'Montreal Screwjob' loss to Shawn Michaels at Survivor Series 1997. They reformed in 1998, dropping Michaels and adding Road Dogg, Billy Gunn and X-Pac. The newly formed group would 'take over' a WCW event in 1998 by interviewing fans at a taping of WCW Monday Nitro (after they drove in army style).
D-Generation X eventually reformed in 1999 and had many incarnations since (mostly one offs), but have never have been as they were during their first two incarnations.