They can have any value. They can be used to control access to a resource that has a limitation on the number of simultaneous access. The semaphore can be initialised to the number of instances of the resource. If process find remaining_instances > 0 then it decreses the value and enter CS. During exit the value will be increased by 1.
It is a classical multi-process synchronisation problem. There is one producer and one consumer. Producer is producing some items until buffer is full, whereas consumer consumes the item until buffer is empty. They share same memory buffer which is of fixed size. But both cannot access the memory buffer at the same time.
There are 5 philosophers sharing a circular table and they eat and think alternatively. There is a bowl of rice for each philosophers and 5 chopsticks. A philosopher needs both their right and left chopstick to eat. A philosopher may eat if there are both chopsticks available else puts down their chopstick and begin thinking again.