If you have interest paid monthly into a savings account how is the amount calculated each month?

For example a Bank offers 4% interest calculated daily paid monthly. Is the interest 4% of the daily amount divided by the number of days in a year? If you had $10,000 at 4% is the calculation $10,000 x 4% = $400/365 = $1.096 so the next day you are getting 10,001.096 x 4% = $400.043/365 and so on assuming no withdrawals are made. This provides "interest on interest" giving more than the advertised 4% interest per annum. Or, do they reduce the amount of interest paid daily so that the amount paid adds up to exactly $400 for a whole year?

Are you better of when the interest is calculated daily and paid monthly than a Bank that offers the same interest rate but only pays annually?