Usually poly provides methods and syntax that older browsers does not support.
For example trim() does not supported by older browsers so the Polyfill file has code something like that.
if (typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,'')
}
}
" text ".trim()
The reason polyfills are not used exclusively is for better functionality and better performance. Native API implementations can do more and are faster than polyfills. For example, the Object.create polyfill
contains only functions that are possible in a non-native implementation of Object.create.