Key exchange: I'll use ECC as an example. Alice and Bob generate ephemeral key pairs and sign their ephemeral public key with their static private key, and then send their signed ephemeral public key to each other.
Both parties receive the others signed ephemeral public key and verify it using the others static public key, stored by a CA or in a PKI. Now they combine their own ephemeral private key with the other's ephemeral public key, using EC Point Multiplication (for this example). Now they both have a shared secret, as both multiplications give the same result.
This is then run through a quick hash like SHA2/3 into the correct length for symmetric encryption. For example with AES-256, the shared secret goes through SHA(3)-256 to get a key of the correct length.
Key encapsulation: I'll use RSA for this example. If Alice wants to communicate with Bob, she will create a symmetric encryption key either with a cryptographically secure psuedo-random number generator or from a HKDF-Expand from another piece of information. Bob sends Alice a signed ephemeral public key (RSA).
Alice then signs the symmetric key using her static private key (RSA), and encrypts it with Bob's ephemeral public key (RSA). Bob receives it, decrypts and verifies the key.