How does PyTest identify the test files and test methods?

I want to know How does PyTest identify the test files and test methods. Can anyone please provide me help regarding that.