As simple as its name. When you open a vendor window, it also opens your bags. When you close the vendor window, it closes your bags.
Due to user request, i've added to open the bags also on bank, guild bank and mail box.
Additionally, if you hold the Ctrl-Key while closing a vendor or bank window, your bags won't be closed.
You can change the behaviour via settings window, accessible with slash command /obav.