The newer versions of WordPress offer the following native functionality:

When a visitor attempt to access a URL that doesn’t exist which is similar to an existing page or post, WordPress will automatically redirect to an existing page that is similar to the naming convention attempted to be accessed.

If you want to remove this, add the following to functions.php:

remove_filter(‘template_redirect’,’redirect_canonical’);

Reference: https://www.elegantthemes.com/blog/tips-tricks/wordpress-canonical-url