You purchase a shop deed and place it like any other building. Then assign one of your pets as a shopkeeper, Charisma increases the customers and Negotiation increases the sell price.; though being a shopkeeper will train these as well.
Simply drop any non-pickpocketed non-furniture item and at the end of each day, your shopkeeper (may) sell some items and deposit the earned cash/items in your shop's strongbox.
In the beginning, you can only keep 10 items in the store, but you can upgrade your store to hold more items (and be larger, but it's more or less cosmetic).
As your shopkeeper sells more items, your shop rank will increase, bringing in more customers as well as earning a small amount of income regardless of items sold.
Items that you sell to NPC shops are capped at 1/3 of it's base value no matter how high your negotiation is, with equipment getting a further 95% price decrease. Your pet shopkeeper doesn't have this limit.
Items sold to you by NPC shops are massively jacked up because you probably have low negotiation skill. If you chose a race/class that starts with negotiation (Which is skill level 4), a 500gp item will cost 10,000gp. At 10 negotiation, a 500gp item will cost 4,545gp. If you don't know the negotiation skill AT ALL, items will cost 100x higher than they normally would.