Am9 A C E G B

Dmaj7#5 D F# A# C#

Gmaj7 G B D F#

Notice that Dmaj7#5 contains an F# major triad. It slides up one half tone to become a Gmaj triad. And, the other note, D, stays the same.

For that matter, the Am9 contains two notes that slide up a half step to become part of the Dmaj7#5 chord.

This is, from one point of view, F#/D (same notes as Dmaj7#5, D F# A# C#) going to Gmaj.

Or, it could be spelled F#/D to Bm/G. V-I in the bass. V-im in the rest.

Voice leading from a half step above or a half step below. The bass note can be treated in a few different ways, changing the sound, but not the concept.

Experiment: Focus on F# triad going to G triad. Nice half step movement. Let's put a G beneath both of them. Now, we've got F#/
G going to G/G.

Next, a D under both. Or a D to G. Or, an Ab going to G. Then, make it an Ab triad going to G and try all the usual suspects for the bass notes.

Next, try it with whole step or b3 movement.

My point is that what makes all this work, or not, is the smooth voice leading.