In entropy coding, also called variable length coding or Huffmann coding, the more likely values are associated to shorter codewords, while less likely values are associated to longer codewords.
Consequently, known the statistics of the event to code, provided that such statistics are representative enough, it is possible to code such event with an average number of bits lower than in fixed length coding.
So a variable number of bits is produced in the time unity, but many applications (transmission usually) need Constant Bit Rate. In this case the decoder needs a buffer, where it stores the received bits at constant bit rate and from which it gets the bits to decode at variable bit rate. The encoder must have a similar buffer for transmission and must take into account the decoder buffer size and buffer fillness so that neither overflow nor underflow occur at the decoder buffer. This is the purpose of Annex C to Specification ISO/IEC 13818-2 entitled Video buffering verifier.
The tool available to control the bit-rate is the changing of the quantiser_scale, but the rate control algorithm isn't specified and it's a responsability of the encoder.