The answers are pretty much all in Canon Law - in the general sections about the sacraments as well as the ones specifically relating to the Eucharist.
There are three things that make for a valid sacrament (in this case we’re discussing the Sacrament of the Eucharist, which for present purposes is synonymous with the Mass).
- Valid form. Meaning the correct form of words must be used. The words ‘this is my body … this is my blood’ must be said by the priest. The authority for this proposition is the most difficult to pin down. Try this article: newadvent.org/cathen/05584a.htm - you need to scroll down to the section headed ‘the sacramental form or the words of consecration’.
- Valid matter. Meaning in this case (as Canon Law prescribes), the bread and wine must be pure wheat flour, unleavened, not mixed with additives such as honey, oil or whatnot, or at least not in discernible quantities. Ie if the bread TASTES like it has honey, olive oil or the like in it, you know it’s invalid. From the Code of Canon Law:
Can. 924 §1. The most holy eucharistic sacrifice must be offered with bread and with wine in which a little water must be mixed.
§2. The bread must be only wheat and recently made so that there is no danger of spoiling.
§3. The wine must be natural from the fruit of the vine and not spoiled …
Can. 926 According to the ancient tradition of the Latin Church, the priest is to use unleavened bread in the eucharistic celebration whenever he offers it.
Can. 927 It is absolutely forbidden, even in extreme urgent necessity, to consecrate one matter without the other or even both outside the eucharistic celebration.
- Valid intent. The priest must intend to consecrate the Eucharist.
From the Canons of the Council of Trent (Seventh Session):
CANON XI.-If any one saith, that, in ministers, when they effect, and confer the sacraments, there is not required the intention at least of doing what the Church does; let him be anathema.
This one is next door to impossible for a bystander to discern, so valid intent is presumed unless the contrary can be conclusively proven.
It goes without saying a valid minister is a fourth requirement - ie a layperson (someone not ordained) or a woman (a person incapable of being validly ordained) cannot confect the Eucharist:
From the Catechism:
1411 Only validly ordained priests can preside at the Eucharist and consecrate the bread and the wine so that they become the Body and Blood of the Lord.
And from Canon Law:
Can. 844 §1. Catholic ministers administer the sacraments licitly to Catholic members of the Christian faithful alone,
who likewise receive them licitly from Catholic ministers alone.
Can. 900 §1.
The minister who is able to confect the sacrament of the Eucharist in the person of Christ is
a validly ordained priest alone.
Apart from these requirements, EVERY other breach of the rubrics or canons makes the sacrament merely illicit and not invalid.