So, the mechanism for low heart rates at rest deals mostly with what we call your Sympathetic/Parasympathetic tone.
As you may have heard theres different types of responses from the nervous and endocrine systems for different types of situations. For example, when you are afraid an increase in adrenaline causes an increase in heart rate.
These processes however don't just occur during these specific times. In reality your heart is recieving constant streams of chemicals from both the nervous and endocrine system. The balance of these is called your 'tone'. At night there is a shift towards the slow side when you sleep, particuarly if you are an athelete (something which slows your heart rate by changing your pattern of 'resetting' and your resting tone).
That all said, a heart rate of 36 while sleeping is perfectly acceptable. At times such a rate can make it challenging to manage some medications, or may pose problems in some conditions such as sleep apnea. However the overwhelming majority of bradycardia at night is sufficient to maintain blood flow and resolves in the morning.