whats the difference between using events in my contract to execute something if event is emitted or executing the function when the transaction is mined? Is there any case in which event may be emitted but transaction fails to be mined?
Transactions can be started by you or by other users of your contract. In the last case, you have no access to the transaction details directly, instead, you program the contract to emit events so that you can track the activity in the contract, make statistics, or react to what the contract is doing.
Hope this helps