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.
In the 2020 major league season, as part of the health and safety protocols adopted to limit the risk of COVID-19 infection, every pitcher was instructed to bring his own rosin bag with him as he came to the mound, and to remove it when he left. Before that, there was only one bag, shared by all the pitchers who made an appearance in the game.