Max/Senator Bailey (Woods) invites Noodles (De Niro) at the party because his political career is about to end, swept up by scandals and frauds and wants his old time friend, with whom he has a 'debt of honor', to kill him before he is completely ruined.
When Noodles refuses to do so and to even acknowledge that Max and Bailey are the same person (it would mean for Noodles to acknowledge also that almost his entire life has been spent in the illusion of a friendship that was never real), the only choice left for Max/Bailey is to kill himself, possibly by throwing himself on the turning blades of the trash truck. This is by the way only suggested by the sequence in which we see Max/Bailey, then the truck hiding him when passing in front of him, then the empty street where Max/Bailey was previously standing after the truck has passed. Or Max/Bailey could also have gone back in his mansion ...
As for the final scene, the one with De Niro's enigmatic drugged up smile (which has been compared to Leonardo's Mona Lisa smile), it is open to the viewer's interpretation. It might mean that everything that happened after Max's death (the faked one) is just an opium induced dream/hallucination by Noodles, or it could be just a flashback. But in that (also) resides, in my opinion, the outstanding beauty of one of my favourites movies.