Startum protocol extranonce2 - where the extraNonce2 comes from I'm curious where the extraNonce2 comes from in stratum protocol? 
In the official documentation, I found

Extranonce2_size - Represents expected length of extranonce2 which will be generated by the miner.

Could you clarify this sentence and give more details?
Extranonce2 is generated by the miner performing the work. When a miner runs out of nonces in the block header, they can increment Extranonce2 in the coinbase transaction to be able to give themselves a much larger search space for a valid PoW for the difficulty that they are mining at.

The pool has to provide the size of Extranonce2 because Extranonce2 is not an actual field in the coinbase but rather part of the variable length arbitrary data that a miner can include in the coinbase transaction. So the pool specifies the size so that the miner knows how much space they have to work with for Extranonce2.