Hope everyone had a nice Rosh haShana!
The Rishonim and Achronim offer numerous answers to explain why the Rambam paskens like Rava (chameitz u'matzah 6:3) that one is yotzei matzah even if coerced to eat and has no kavanah to fulfill a mitzvah but by shofar the Rambam paskens (2:4) like R' Zeira that one is not yotzei shofar without kavanah to fulfill the mitzvah. Putting that issue aside, the Yom Teruah asks: the gemara (Kesubos 86) writes that if one refuses to build a sukkah or make a lulav Bais Din imposes malkos until the person relents and does the mitzvah - doesn't this prove Rava's point that mitzvos fulfillment can be coerced and kavanah is not integral? The Yom Teruah distinguishes between the matzah case where the coercion is done by Persians who certainly have no mitzvah kavanah and the case of coercion by Bais Din which is done with their intent to see a mitzvah fulfilled. The Aruch laNer says this distinction is irrelevant - the kavanah of Bais Din is no substitute for the person's own kavanah. Aruch laLer offers an interesting distinction between eating matzah, which itself is a mitzvah, and building a sukkah or making a lulav, which are just hechsheirim to allow the person to accomplish the mitzvah act. Mitzvos tzerichos kavanah, but hechsheirim that enable the mitzvah to be performed do not.