State tax filing

yes I see the same thing in 2022 whereby I received a large refund from NY state.  When I do a simple math of calc how much I paid in NY taxes vs wages for NY, I get 10.84%.  So just divide W2 box 17 / box 16.  When I look at the calc in turbo tax, it is using around 6.8% tax.  This is resulting in a large refund.  In 2022, I received a refund from NJ as well but in 2023, I had to pay taxes with a penalty.  I sort of understand this as I had some additional NJ income that wasn't taxed when earned.  I looked into this a bit more and what I see is that my employer is taking out about 7% for NY state tax on a per paycheck basis.  However, I am in a field where there is a one-time bonus each year and when that occurs, I see my employer is withholding close to 11% for NY state taxes.  I am not sure why that is.  Anyway, I went in an adjusted by W4 with the employer for NY state and changed it from 0 allowances to 3.  I will see if this helps.