A hard disk can be separated into several partitions each appearing as independent drive with its own letter in Windows explorer.
This can be done with an SD-card or USB flash drive, too, but it is normally very uncommon, except when an operating system is installed on the drive. There is typically a small drive of just a few 10MB for initial booting (e.g. UEFI), and at least one larger partition for operating system and data.
Now, this smaller partition is formatted with FAT, which Windows can understand. You formatted this partition, and it is empty now.
The larger partition is formatted with ext4 in case of Raspbian. Windows doesn't understand this, and so doesn't display it, or even assign a letter for it.
Go to disk management in Windows. In the lower half of the window, each physical hard drive is shown as row, with the partitions as blocks on it. You'll notice the small 30MB partition, and a large "unknown" one.
Delete both, create a new partition over the entire space, and format it. After, you have the full capacity "back".