The logical time in distributed systems is used to maintain the consistent ordering of events. The concept of causality, i.e. the causal precedence relationship, is fundamental for distributed systems. Usually, it is tracked using physical time, but physical clocks are hard to maintain in a distributed system, so logical clocks are used instead. The idea that makes logical clocks different is that these are designed to maintain the information about the order of events rather than pertaining to the same notion of time as the physical clocks.
A logical clock must specify the following two rules to implement proper functionality:
Lamport clock is a simple logical clock implementation. The illustration above shows the working of Lamport clock algorithm. You can find explanation in this article.
Logical time has many applications in distributed systems.