“Pact” is effectively a synonymous term with “treaty,” although treaty is more often used in actual legal terms. A pact also does not necessarily have to be made between two different sovereign states, which is often the meaning put to treaties. Pacts can instead be made between two parties within a single nation.
Pacts generally are a form of partnership or agreement in which the involved parties set out terms and agree to abide by them for the benefit of both parties. Pacts commonly include some form of alliance between different parties, for example, for the benefit of all involved parties. Making a pact would likely involve giving some sort of promise or assurance that under certain conditions, the party to the pact would act in a particular fashion.
A non-aggression pact is a common form of pact sometimes known as a peace pact, although this term is something of a misnomer for what it implies. A non-aggression pact is effectively an agreement made between two parties to not engage in aggressive behavior towards one another.
This means that a non-aggression pact is most often made between two different countries and involves agreeing not to go to war with one another. It does not, however, involve both countries agreeing not to go to war, period, which is why a non-aggression pact is somewhat different from what a peace pact might imply. The participants in a non-aggression pact might go to war with each other’s allies, but still would technically not go to war with each other under the terms of the pact.