A rosin bag is a small canvas bag filled with rosin powder (a sticky substance extracted from the sap of fir trees) used by pitchers to improve their grip on the baseball and keep their hands dry. The rules specifically allow the rosin bag to be kept on the field of play. The bag is usually left lying on the ground on the back side of the pitcher's mound. It can only be used when time is called and the pitcher steps off the rubber. He will usually rub his hands while walking behind the mound, his back turned to the batter.
The bag is considered to be part of the playing field, like a pebble or any other natural obstacle. A batted ball that hits the bag is still in play. It is why pitchers make sure to keep it out of the way, so that it does not deflect routine ground balls hit across the mound.