Working out is not painful, it's uncomfortable. There's a difference between discomfort and pain. Pain is when you dislocate your shoulder, or scrape your knee. Discomfort is when your heart rate is up, and you are sweaty and tired. Pain is when you burn your hand, discomfort is when your muscles are sore and shaky.
Pain is your body is sending signals that something is dangerous and hurtful to your body. Working out is generally not dangerous or harmful, so we can come to the conclusion that the feelings we experience are not those of pain, but instead those of discomfort.
Learning the distinction can help a lot with training. We can recognize when we are not working hard enough and when we are overdoing it.