When you add your NN layer, it internally uses kernel_initializer which gives the initial weight and bias to your model. So the model can find loss and start back propagation process and again change that initial weight and bias.
So if you are using keras then you can go through the keras_initializer document. I have attached the link for your reference.
Hope this will help you.