Assuming you mean sending some USD from the US to an overseas recipient, it goes a bit like this:
1. Your bank sends a secure message to the overseas bank through the SWIFT network (this is where the SWIFT number is used for routing the message) to the recipient's bank, detailing the transaction.
2. Through the SWIFT standard message format, the overseas bank validates whether the account exists in their bank. Some additional screening is done at this stage to detect fraud, money laundering, etc.
3. Your bank and the overseas bank have a predefined agreement on a correspondent account, i.e. a bank account in the US owned by the overseas bank to receive USD. If everything checks out, your bank wires the money via a domestic system like Fedwire to settle the transaction.
4. The overseas bank confirms that the money was wired to their US account, and then adjusts the recipient's balance accordingly.