I suggest that the discord and tension in the house is affecting your daughter. Her accidents are a sign that there is too much stress put on her. She's caught between you, her mother, and her grandmother, your mil. She hears the two of you fighting every day. If she's like my granddaughter, she loves both her mother and her grandmother and when the two of us fight (which we did often when my granddaughter was 3) she suffered.
I urge you to find a way to get your own home. I saw in an earlier post that you were putting your daughter into a private pre-school. If you have money for that I suggest that you can find a way to have money for your own place. Your own place, even tho it's small and not as nice as your in-law's house, will be much more peaceful.
In an earlier post you also said you were working for the school district until June but you were saving to move. I am confused about why you're living with your in-laws. You're obviously unhappy. LIfe is difficult with your in-laws. Get your own place, no matter how small or unlike what you want.
And stop your "small humiliation" with her. This doesn't help because it lowers her self-esteem. Humiliation is a way of putting her down, telling her she's just a baby. She needs to feel good about herself and her ability to stay dry in order to stay dry.
Do you think you're doing a better job of being a parent because your mil humiliates you with her "snotty remarks"? Does her put downs make you feel better and want to do a better job? Do you even understand what it is that your mil wants you to do? I suggest your daughter is feeling similar to the way you feel. Small humiliations do not work in the long run. Your daughter is little and helpless and so she tries to be "good." You fight back. Both of you feel bad.
I also want to tell you that it's common for children to get busy and not go to the bathroom in time. I suggest that, because of the anger and turmoil in your lives, that she is probably spacing out in stress. You've put her in the middle between you and your mil. This is a very difficult position in which to be as an adult. A 4 yo does not have skills to deal with this sort of stress.
I feel for all of you. You are in an impossible situation. Find a way to get your own place!