Semantically they're very similar, but syntactically, the difference is that underlying is an adjective, whereas underneath is either a preposition or an adverb.
The syntactic difference means that, like most adjectives, underlying usually occurs before the noun it modifies...
This sentence illustrates my underlying point.
...but note that we can also use it as a "continuous verb form", with "point" as the subject...
The point underlying that sentence is made again here.
Apart from that syntactic difference, note that the relatively less common underlying usually refers to something fundamental, that underpins something else, whereas underneath (and plain under) merely implies something being (physical or figuratively) below something else.