How is dharma formed?
I guess you are asking about Dependent Origination?

You can find detailed information in "Learning materials for Dependent Origination (Paṭiccasamuppāda) in Theravada Buddhism".

For a perspective from the Abhidhamma, "The Abhidhamma in Practice" may be helpful.