A game mechanic dice rolling in a game can be used for many things, randomness being the most obvious.
Dice can also be used as counters; start at 6 (for a normal die: singular for dice) and turn it to 5 at the end of a round, single player's turn etc. The dice themselves can be unique and different sizes, shapes and colors to represent different things.
In wargames, dice are used in conjunction with a variety of tables, notably a "Combat Results Table" which produces a result by strengths of both sides (either as a ratio or a differential) and a die roll (1D6, 2D6, and 1D10 are most commonly used).
Dice rolling can be a game in and of itself see Yahtzee or Craps.
Dice games fan