A line within a block with colour ByLayer on layer "Linework" gets the colour assigned to layer "Linework".
A line within a block with colour ByBlock on layer "Linework" gets the colour assigned to the block.
A line within a block on layer 0 with colour ByLayer gets the colour of the layer the block is inserted on.
If you want to control the appearance (colour) of some part of the block, you can assign the ByBlock value to that part of the block, which really means that this part of the block doesn’t have any value assigned until it’s inserted in drawing.
Let’s assume you have a block (for example a bolt), which contains a centreline and you want to control its colour for every instance of block inserted on any layer. In that case, you must assign the ByBlock value to the centreline before you create this block (you can also change it afterwards, in the block editor).
Colour of objects you want to control set to ByBlock, and then create block definition.
After you create the block and insert it in a drawing, you will notice that the centreline behaves as if the ByLayer colour property has been assigned. Change the colour of the centreline to some explicit colour (e.g. green) in the properties panel while no command is active and then insert the block. You will see the centreline is now green and if you change this block’s layer, you will see that the colour stays green or unchanged, while the bolt changes colour according to layer that the block resides on.
The main prerequisite is that all elements of the block reside on layer 0 before the block definition is created.