If your Electronic Travel Authorisation (ETA) is valid on the start date of your trip but expires during your stay in Canada, i.e. before your return date, you do not need or must apply for a new AVE covering your entire stay.
If you wish to stay beyond the authorised 180-day period (or less, depending on what the immigration officer decides and indicates in your passport), you must apply for an extension at least 30 days before the end of your stay. A visitor record will be issued to you. A visitor record is not a visa.
A visitor record is a document that gives you visitor status in Canada and allows you to stay longer, with a new expiry date for leaving Canada.