What is the difference between a threaded bottom bracket and one with press-fit bearings?
What is the purpose of a bottom bracket like the kinds sold by Shimano etc.?

The purpose of any bottom bracket (BB) made by any manufacturer is to allow cranks to freely rotate in the bottom bracket shell (part of the frame).

How does this differ from bearings, spacers and seals that are directly press-fit into a bike frame?

Different frames accept different types of BBs. Some of them are threaded into it, some are pressed into it. There are many incompatible designs of threaded BBs, and several incompatible types of press-fit BBs.

Are both used on the same frame, or do they serve the same purpose?

A frame is designed to accept either a variant of a threaded BB, or a variant of a press-fit BB. Seldom it is possible to modify the frame to accept a different type of BB.