I always see PWM pin in microcontrollers, like in PIC what is/are the use of it?
While PWM is indeed used for motor control, I'd say the main use for PWM is digital to analog conversion, in case the MCU doesn't have a DAC on chip (they most often don't). The PWM duty cycle can be used to represent an analog value, if you connect the PWM output to an op amplifier. This is a quite common design in all kinds of applications.
Most kinds of systems reglating something is using a PWM + an op amp to give an analog output, which can be used to control some sort of hardware. Then this analog output can be read back into the MCU, through an analog to digital converter, and the MCU can alter the PWM duty cycle accordingly.