A D Major 6 (D6) chord contains the notes D, A, B, F#. It is built from the major 6th formula 1 - 3 - 5 - 6, with D as the root.
What is the difference between D6 and Bm7?
They contain identical notes — D, F♯, A and B. The difference is which one the bass and the progression treat as the root. Over a D bass the chord sounds like a bright, settled D6; over a B bass the same four notes sound like a moody Bm7. One shape, two functions, decided entirely by context.