I'm not a doctor either. Just a longtime athlete who's had every injury in the book and who spent 5 years working in physical therapy.

Ken is exactly right. You didn't mention your backround or a specific type of pain. From the limited information it's hard to even venture a guess. The knee is a very complicated joint. Anatomically it's actually two joints.

You hiked a long way which you presumably don't normally do, presumably with a pack, presumably in shoes or boots you normally don't wear. Those are all things your knees are not used to and they're going to protest.

You have what is usually called an overuse injury. The name says it all. If you're not feeling way better in a few days I would seek professional attention if I were you. I the meantime, try some stretching. It can work wonders on some types of injuries.
_________________________
If you only travel on sunny days you will never reach your destination.*

* May not apply at certain latitudes in Canada and elsewhere.