capacity is how much space you have allocated, and size is how much of that space is actually used.
clear will set the size to 0, but probably doesn't change capacity (ie: it doesn't actually free the memory). This isn't guaranteed, though.
In any event, that's for vector. map works differently (it's more like a list with individual nodes rather than an array) so it doesn't really have a capacity.
Exact behavior isn't specified by the standard. It depends on the implementation.
It doesn't really matter, anyway. If you're really worried that much about memory consumption, you can make the vector with new and then delete it when you want to free all the memory.
Again... also note that map doesn't really have a capacity because it's based on individual linked nodes and not an array.
Interestingly, my friend had a large vector that he tried to do that with in Debug mode in VC++, and when he deleted it and remade it (to reset it's capacity), it had the same capacity as it had before. Exactly the same (10,000 IIRC). We weren't really sure why that happened...