Cornstarch acts as a thickener, giving the filling a firmer structure that slices cleanly and holds its shape when served.