Medieval worlds

Why might a ruler grant a town the right to hold a market on specified days?