They are different shapes, each shape has both a plug and a corresponding socket. USB A is the traditional rectangular plug/socket, while USB B is the bulky somewhat square shape usually found in printers. There are also mini and micro versions of both A and B, each having both a plug and a socket.
The traditional USB connection has a host with a USB A socket, which provides power; a cable with a USB A plug in one end and a USB B plug in the other end; and a device with a USB B socket. All traditional USB cables are A to B cables, with a USB A plug and a USB B plug; an A to A cable would allow connecting two hosts together, and both would try to provide power at the same time, which might damage the hardware.
USB-C is completely different; all cables have two USB-C plugs, while both hosts and devices have USB-C sockets. Which side provides power is negotiated through a dedicated configuration channel.