Diffie and Hellman built on Ralph Merkle principles to devise a way for two strangers to create a shared secret resistant to third-party prying.
Like in the Merkle solution, D-H let Alice present choice options to Bob, allowing Bob to communicate his selection to Alice unbeknownst to others.
Alice in turn communicates her choice to Bob, obscure to others, such that Alice and Bob can now compute the same result using each their random selection data, but both computing the same shared result, which is beyond reach to their hackers.
The shared result that both compute from different input then becomes their shared secret.
D-H introduced a most powerful notion to cryptography: the idea of two linked (mutually derivable) pieces of data such that it is very hard to exercise the link and compute one piece of data from the other. Yet, because they are linked, they can each be used to compute the same result -- the shared secret.
D-H used the terms "public key" and "private key" for these pieces of data. Rivest, Shamir and Adelman (The RSA group) have expanded this powerful concept in their solution for communicating a secret between strangers.