The Trim Events to Include All Frames option is for automatically adjusting the length of events according to the frame rate.
It is mainly used to automatically adjust the length of events when using Slow Motion and Fast motion effects where the frame rate is changed to modify the speed of events.
See my screen recording below. Note that at first, when applying the velocity envelope, I didn't use the Trim Events to Include All Frames option and had to manually adjust the event length. Later, when I activated the option Trim Events to Include all Frames, the length of the event was adjusted automatically.