See this passage explained in the notes at Matthew 15:32-39.
In those days - While in the wilderness, where he had cured the deaf-mute man.
Having nothing to eat - Having come unprovided, or having consumed what they had brought.
I have compassions - I pity their condition. I am disposed to relieve them.
Four thousand - Four thousand “men,” besides women and children. See Matthew 15:38. See this passage explained in the notes at Matthew 15:32-39.