The Victory Medal belonged to Pte William John Boaden of the 3rd Battalion Devonshire Regiment.
It was found in a farmer's field in Porthcawl by a team of metal detecting enthusiasts.
Researcher Stephen Lyons then tracked down Pte Boaden's family in Tiverton, Devon, where he was born in 1897.
But it is still not known how the medal came to end up in the field.
Pte Boaden signed up on the outbreak of the First World War aged 17.
His regiment served in France and Belgium, Mesopotamia, Salonika, Macedonia, Egypt, Palestine and Italy.
The medal is badly damaged but Pte Boaden's name and regimental number are still visible.
Chris Jeffreys made the discovery after sitting down on a fallen tree to take a break from metal detecting.
"I didn't have many finds that day," he said, until his detector picked up a "beautiful signal" around the tree.
"The area had been covered dozens of times before, so whether the tree falling disturbed something I don't know.
"It's the first medal I've found," he added. "I was overjoyed."
Keen to unravel the mystery of how the medal ended up in the field, Mr Jeffreys and his fellow metal detecting enthusiasts appealed for help to find out what happened to Pte Boaden.
A First World War expert based in Cwmcarn, researcher and historian Stephen Lyons answered the appeal.
Following a tenacious and at times pain-staking research, he tracked down daughter-in-law Moira Boaden and his grandson Stephen Boaden living in Tiverton, Devon.
Mr Jeffreys recently met them to present the medal.
Mrs Boaden said she was "delighted" as she never knew of its existence and that the family "will treasure it".
"It's so interesting hearing all the history of my father-in-law."
Stephen Boaden said he had nothing of his grandfather's, not even a photograph, until recently.
"It was a very nice surprise," he said.
"To find out so much information about what he went through and who he was - it gives him a personality."
He added that the medal was not just something that belonged to his grandfather, but was "evidence of his service to his country."
A war medal found in a field in Bridgend county has been returned to its rightful owners almost a century after it was awarded.