Why does a byte consist of #8# bits?
For historical reasons.
Before microprocessors, some of the earliest Arithmetic Logic Units (ALU's) - the chips that performed basic operations on binary numbers - were capable of handling 4 bit quantities at a time, known as a nybble.
Some of the earliest microprocessors (e.g. 4004) were also 4 bit processors.
The 4 bit ALU's tended to be combined to handle larger quantities, hence 8 bit bytes, 16 bit words, 32 bit double words, etc.
There were some exceptions, such as the General Electric GE-600 mainframes, which had a 36 bit word. This supported both 6-bit and 9-bit bytes.