Reason for adding .value to access node id? I was trying to access node id in twig. After debugging for a while I found that node.nid was holding the value I wanted. However, when I tried to render using that variable it didn't print anything. After struggling for while I found that I need to append .value in the end which obviously worked. But I am not sure reason behind using .value. Can someone tell me when and where should we use such?
Short answer: Because nid is a field and you want to get the field value.

Long answer: Node is like User or Taxonomy Term an entity and provides the method id(). So instead of accessing the id fields by their individual field name (nid, uid, tid), it's easier and better OOP practice to use the method EntityInterface::id:

{{ node.id }}