I find the subject very arbitrary, so here is my opinion based on my experience while working in different labs and cultures.
Although there are guidelines about who should be an author, like the ones mentioned in other answers, I find the practises by different labs/PIs to vary very much. Besides, these guides are just recommendations that researchers tend to follow or not.
Take this example.
The ICMJE recommends that authorship be based on the following 4
criteria:
Substantial contributions to the conception or design of the work; or
the acquisition, analysis, or interpretation of data for the work;
AND Drafting the work or revising it critically for important intellectual
content;
AND Final approval of the version to be published;
AND Agreement to be accountable for all aspects of the work in ensuring
that questions related to the accuracy or integrity of any part of the
work are appropriately investigated and resolved.
So, if we follow these guidelines, any co-author should have substantial contribution to the conception or design of the work or analyse the data or interpret the data.
Then it is required to participate in the draft. Either by writing and/or by reviewing it substantially.
Then to approve the manuscript and finally to be responsible for all its contents.
The first two are the actual contribution, the last two is the acceptance of the responsibilities that derive from having your name (or your signature) on a document: Do you approve the publication as ready? Can you stand for it and defend it?
Now, approving it might be a big deal in a way. To what extend should you agree with all the findings? (that can be an opinion based question to pose one day in SE). I can be almost certain that I know of people that are co-authors because they did contribute, although they don't necessarily know what is the paper about or they can't defend all of its aspects (e.g. in a interdisciplinary study, how can you defend a method that a colleague performed and you are not an expert on it or how can you defend a whole paper when your contribution was on a specific part of it).
But back to the first two: these are the questions you have to answer. It is about the contribution to the results and contribution to the draft. The question for you would be, the identified gap, was it significant enough to justify a change in the concept or the design of the project? If yes, then your colleague could deserve a co-authorship.
Next, did the reviewing of the manuscript require and offer significant intellectual input? If yes, you can cross this requirement also.
And the other two is questions your colleague has to answer if the first two are fulfilled.
In summary, the requirements recommended by the journals or other associations are a little arbitrary and ambiguous, I believe on purpose, because every study is special, every collaboration unique and every contribution, honestly, quite subjective. If you feel the contribution changed the way you saw your data and the input improved substantially the quality of your manuscript, then a co-authorship should be offered.
PS. I can't find it now, but I remember colleagues gossiping about paper(s) where the contribution of some of the co-authors was to be present in the project meeting and it was supposed to be written in the "contributions" field.