Race condition is like a family of n members(processes)
Each family member is sharing food(resources) which is present in Kitchen(Critical section)
Now the condition is one member can enter the kitchen at a time,
but all the persons need to eat food to stay alive.
So Race condition is when the state of a system depends on participating processes.
It is called race condition because processes need resources and they are sharing these resources, so they are like in a race to enter the Critical section(kitchen) to eat food.(having acquired the resources).
Now one important thing is after eating food, you have to excrete(There is some mechanism through with excreted food is converted again into fresh food by an algorithm)
This operation is known as Releasing all the resources once you get out of the critical section.