This can happen when the mixture is a compound. Compound is different from a mixture as mixture is made by physical change and making compound is a chemical change.In a compound there are two or more different molecules but they are chemically mixed that forms a new substance so it is called compound. Ex-H2O it is the formula of water. H means hydrogen and O means oxygen. It is a compound and a pure substance.
In compounds the molecules combine with each other in definite propotional having different properties from their constituent molecules whereas mixture retain the properties of their constituents elements and combine physically.