Bulbapedia explains this quite well:
> A Depot Agent handing out lost-and-found items lives in the south-eastern house, initially giving the player a Rare Candy. When visited, he will give a vitamin, Max Revive, or Max Elixir for each set of seven consecutive battles won at the Battle Subway since last visit, capping at ten.
For every seven wins at the Battle Subway, you will recive one of the mentioned item. You cannot control which one you will get though.