How getEvents works (and what it actually returns)
CalendarApp.getCalendarById('primary') gives you the signed-in user's default calendar. Pass any calendar ID from your Calendar settings for a secondary calendar. getEvents(startDate, endDate) returns every event whose start time falls within that window, up to Google's undocumented hard limit of 2,500 events per call.
Both Date objects are constructed from ISO strings, which sidesteps timezone ambiguity better than passing year/month/day integers. Set startDate to T00:00:00 and endDate to T23:59:59 on the last day you want cleared, or events that begin at midnight on the boundary day will be missed.
The returned array is flat: each item is a CalendarEvent object. Recurring event instances come back as individual items, so deleteEvent() on each one deletes only that occurrence, not the series. To nuke the whole series you would need deleteEventSeries() — a different method entirely.