I am reading English Grammar in Use by Raymond Murphy.
I have seen 2 sentences below,
It is a beautiful painting?
Yes, it is the most beautiful painting I have ever seen.
I dont know why did they use "ever" between have and seen.
Is your question about why "ever" is needed at all?
That is, do you want to know how these two are different?
It is the most beautiful painting I have seen.
It is the most beautiful painting I have ever seen.
These two mean the same thing. However, the second is preferred for several reasons:
In your sentence example, ever is a superlative adverb and is linked to most, and as an adverb it could be placed either way
1) I have ever seen
2) I have seen ever
3) I ever have seen
where ever is defined by the totality of relevent experience, usually understood to be one's life time, but could also be
Queen Elizabeth is the longest reigning monarch ever in the UK.
Where is relevant experience is the history of the UK.
From my experience #1 is used most often. #2 can be used for emphasis, where there is a slight pause before ever and then the ever is emphasized similar to really. #3 is more poetic and literary in its cadence.
In that particular sentence and in many instances of practical uses of English Grammar, ever is used between have and seen : 1. To emphasize the degree of interest in an object 2. To indicate the totality of time before actually seeing that object. To put simply, in one's lifetime 3. Used in affirmative sentences before superlatives to pass the sense 2 (above)
I would say that it gives the sentence a word that can be emphasized and possibly a better-sounding rhythm. It also helps avoid some confusion. I think I would dare to say that most of the time when no timeframe is mentioned the context is going to imply how far back to consider the comparison/superlative. So depending on the setting it could implicitly meant something like these:
"...have seen [during our visit to the art gallery today.]"
"...have seen [since I started working at this art gallery.]"
"ever" or "ever in my life" refers to the total time span of your life.
As a mathematician, I would say that 'ever' is technically superfluous.
Probably the context might be that the previous sentences consisted of things like 'it is the most beautiful painting I have seen today' or 'it is the most beautiful painting I have seen in the museum'
In your particular example, the word 'ever' may be left out because in this context, the implied time period of question actually is 'ever' and the meanings match.
However, contrast "Have you seen John?" and "Have you ever seen John?". In this case (again, depending on the wider context) the answers may well be different - the first question can be used with a meaning closer to "Have you seen John today/recently, I'm looking for him, where is he?" and thus you may have a truthful answer of "No" even if you have seen him last week.