A judicial review into the funding of care home places has heard how the future of dozens of elderly and vulnerable residents needs to be decided.
Four homes in Pembrokeshire claim they could close within weeks because of underfunding.
At present Pembrokeshire council pays fees of £390 per week for every resident it funds.
The homes are asking for that to rise by £90 to £480.
Eighty-six people stay at Pen-coed in Saundersfoot, Langton Hall in Fishguard, Woodfield care home in Narberth and Woodland Lodge, in Tenby.
The money Pembrokeshire council pays care homes to look after residents is being challenged in the High Court.
Care home managers say the funding they receive is not enough to meet their costs.
They also dispute the way the figures have been calculated, saying there have been basic errors in logic and double calculating.
The council pays for half the residents and says their payments are set fairly.
Pembrokeshire council says other local authorities in Wales pay less to some care homes and says the financial problems with the four homes in the court case are nothing to do with how fees are set.
Care Forum Wales, which represents independent care providers, have been given positive reviews from the care homes regulator, Care and Social Services Inspectorate Wales (CSSIW).
The judicial review is concentrating narrowly on the fees in Pembrokeshire but these are issues facing care homes and councils across Wales.
With purse strings tightening due to cut backs in public spending, change is happening in an area which deals with the most vulnerable people in society.
Pembrokeshire council leader John Davies has said that if the local authority agreed to pay £500 per week to all homes in the county, it would increase the authority's costs for residential and nursing home care by £2.25m.
The judicial review which began on Tuesday is expected to last for three days.